package com.hsgene.order.constants.v1;

/**
 * @desc:报告状态
 * @author: fuxiang
 * @date: 2018/9/30 12:03
 */
public enum ReportStatus {
    INIT(1,"init","init"),
    DELIVERED(2,"delivered","delivered"),
    DONE(3,"done","done"),
    /**
     * 异常
     */
    EXCEPTION(-1, "exception", "异常");
    private final int code;

    private final String value;

    private final String desc;

    ReportStatus(int code, String value, String desc) {
        this.code = code;
        this.value = value;
        this.desc = desc;
    }



    public static ReportStatus getEnum(int code) {
        for (ReportStatus status : values()) {
            if (status.code == code) {
                return status;
            }
        }

        return EXCEPTION;
    }



    public int getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

}
